<template>
  <div id="app">
    <nav v-if="sc">
      <router-link to="/">首页</router-link> |
      <router-link to="/about">购物车</router-link>
    </nav>
    <router-view/>
  </div>
</template>
<script>
export default {
  data() {
    return {
      sc: true,
    };
  },
  watch:{
      $route:function(n){
        console.log(n);
        if(n.path=='/info'){
          this.sc=false
        }else{
          this.sc=true
        }
      }
  }
  
}
</script>
<style lang="scss">

nav {
  padding: 30px;

  a {
    font-weight: bold;
    color: #2c3e50;

    &.router-link-exact-active {
      color: #42b983;
    }
  }
}
</style>
